<template>
  <div class="test">
    <tree-node :node="tree" />
  </div>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";

import TreeNode from "@/components/css/TreeNode.vue";
export default defineComponent({
  components: {
    TreeNode,
  },
  setup() {
    const tree = ref({
      label: "",
      childs: [
        {
          label: "1级菜单",
          childs: [
            {
              label: "2级菜单",
              childs: [
                {
                  label: "3级菜单",
                  childs: [
                    { label: "4级菜单" },
                    { label: "4级菜单" },
                    { label: "4级菜单" },
                    { label: "4级菜单" },
                  ],
                },
                { label: "3级菜单" },
                { label: "3级菜单" },
              ],
            },
            {
              label: "2级菜单",
              childs: [
                { label: "3级菜单" },
                { label: "3级菜单" },
                { label: "3级菜单" },
              ],
            },
          ],
        },
        {
          label: "1级菜单",
          childs: [
            { label: "2级菜单" },
            { label: "2级菜单" },
            { label: "2级菜单" },
            { label: "2级菜单" },
          ],
        },
      ],
    });

    return { tree };
  },
});
</script>
<style lang="scss" scoped></style>
